<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>MeteoCal - Edit Event</title>
	<link rel="stylesheet" type="text/css" href="${request.contextPath}/resources/css/main.css" />
    </h:head>
    <h:body>
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="60" resizable="false" closable="false" collapsible="false">
		<ui:include src="/includes/header.xhtml"/>
            </p:layoutUnit>
	    <p:layoutUnit position="center" class="content">
		<h1>Edit Event</h1>
		<h:form>
		    <h:panelGrid columns="2">
			<p:outputLabel value="Event name:" for="eventName" />
			<p:inputText id="eventName" value="#{eventController.selected.eventName}" title="#{bundle.EditEventTitle_eventName}" />
			<p:outputLabel value="Date:" for="eventDate" />
			<p:calendar id="eventDate" value="#{eventController.selected.eventDate}" showOn="button" pattern="MM/dd/yyyy" />
			<p:outputLabel value="Start time:" for="eventStartTime" />
			<p:calendar id="eventStartTime" value="#{eventController.selected.eventStartTime}" pattern="hh:mm a" timeOnly="true"  />
			<h:outputLabel value="End time:" for="eventEndTime" />
			<p:calendar id="eventEndTime" value="#{eventController.selected.eventEndTime}" pattern="hh:mm a" timeOnly="true"  />
			
<!--			<p:outputLabel value="Address (line 1):" for="eventAddress1" />-->
			<!--<h:inputText id="eventAddress1" value="#{eventController.selected.eventAddress1}" title="#{bundle.EditEventTitle_eventAddress1}" />-->
			
<!--			<p:outputLabel value="Address (line 2):" for="eventAddress2" />-->
			<!--<h:inputText id="eventAddress2" value="#{eventController.selected.eventAddress2}" title="#{bundle.EditEventTitle_eventAddress2}" />-->
			<p:outputLabel value="City:" for="eventCity" />
			<p:inputText id="eventCity" value="#{eventController.selected.eventCity}" title="#{bundle.EditEventTitle_eventCity}" />
			<p:outputLabel value="Outdoor event:" for="eventIndoorOutdoor" />
			<p:selectBooleanCheckbox id="eventIndoorOutdoor" value="#{eventController.selected.eventIndoorOutdoor}" />
			<p:outputLabel value="Public event:" for="eventPublicPrivate" />
			<p:selectBooleanCheckbox id="eventPublicPrivate" value="#{eventController.selected.eventPublicPrivate}" />
			<p:outputLabel value="Description:" for="eventDesciption" />
			<p:inputTextarea cols="100" rows="10" id="eventDesciption" value="#{eventController.selected.eventDesciption}" title="#{bundle.EditEventTitle_eventDesciption}" />
			<h:outputText value="" />
			<p:commandButton type="submit" value="Update event" action="#{eventController.eventPageUpdate()}" ajax="false" />
		    </h:panelGrid>
		    <br />
                    <h:commandLink action="#{inviteeController.invitationCreate}" value="Crate new invitation"/>
		</h:form>
	    </p:layoutUnit>
	    <p:layoutUnit position="south" size="80" resizable="false" closable="false" collapsible="false">
		<ui:include src="/includes/footer.xhtml"/>
	    </p:layoutUnit>
        </p:layout>
    </h:body>
</html>

